package com.bestcem.xm.member.enums;

import com.bestcem.xm.common.core.enums.CommonEnum;

/**
 * 导入记录状态
 *
 * @author yf.wang <yf.wang@idiaoyan.com>
 * @version V1.0
 * @date 2021/7/20
 */
public enum ImportRecordStatusEnum implements CommonEnum {

    IMPORT_RECORD_STATUS_PROCESSING("进行中", 0),

    IMPORT_RECORD_STATUS_FAILED("导入失败", 1),

    IMPORT_RECORD_STATUS_SUCCESS("导入成功", 2),

    IMPORT_RECORD_STATUS_WAITING("等待中", 3);


    private String name;

    private int index;

    ImportRecordStatusEnum(String name, int index) {
        this.name = name;
        this.index = index;
    }
    @Override
    public int getIndex() {
        return index;
    }

    @Override
    public String getName() {
        return name;
    }

    public static ImportRecordStatusEnum getByIndex(int index) {
        ImportRecordStatusEnum[] values = ImportRecordStatusEnum.values();
        for (ImportRecordStatusEnum value : values) {
            if (value.getIndex() == index) {
                return value;
            }
        }
        return null;
    }

}
